<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<FiltronASP.Areas.Admin.ViewModels.Menus.MenusEditionViewModel>" %>
<%@ Import Namespace="FiltronASP.Areas.Admin.Consts" %>
<%@ Import Namespace="FiltronASP.Models.DAO.Extensions" %>

<%= Html.HiddenFor(m => Model.MenuItemToOperateWith.item_id) %>
<%= Html.HiddenFor(m => Model.MenuItemToOperateWith.item_type_id) %>
<%= Html.HiddenFor(m => Model.MenuItemToOperateWith.parent_item_id) %>
<%= Html.HiddenFor(m => Model.PaginationPage) %>
<% if (Model.CurrentMenu != null) { %>
    <%= Html.HiddenFor(m => Model.CurrentMenu.menu_id)%>
<% } //if menu id %>
<% if (Model.CurrentLanguage != null) { %>
    <%= Html.HiddenFor(m => Model.CurrentLanguage.language_id) %>
<% } //if lang %>
<script src="../../../../Content/Admin/JS/menu-item.js" type="text/javascript"></script>        
<div class="right-page-item">
    <label for="item_name">Nazwa:</label>
    <%= Html.EditorFor(m => Model.MenuItemToOperateWith.item_name, "InputText")%>
    <%= Html.ValidationMessageFor(m => Model.MenuItemToOperateWith.item_name)%>
</div>              				                                    				           
<% if (!Model.MenuItemToOperateWith.EditionWithPageCombos()) { %>
    <div class="right-page-item">
        <label for="item_link">Link:</label>
        <%= Html.EditorFor(m => Model.MenuItemToOperateWith.item_link, "InputText")%>
        <%= Html.ValidationMessageFor(m => Model.MenuItemToOperateWith.item_link)%>
    </div>
<% } else { //if not combos %>
    <%  if ((Model.PageTypesToDropDown == null) || (!Model.PageTypesToDropDown.Any())
                || (Model.PagesToDropDown == null) || (!Model.PagesToDropDown.Any())) { %>
            <div class="right-page-item">
                <br/><br/>
	            Brak zdefiniowanych typów stron lub stron, na podstawie których można ustalić link elementu menu.
            </div>    
    <% } else { //if empty %>
            <div class="right-page-item">
                <label for="dummyTextBox">Link:</label>
                <%= Html.TextBox("dummyTextBox", Model.MenuItemToOperateWith.item_link, new { @class = "right-input-readonly", @readonly="readonly" }) %>
            </div>
            <div class="right-page-item">
                <div class="subheader">Zmień bieżący link:</div> 							
            </div>																	
 	        <div class="right-page-item">
 	            <div class="right-page-item300">
 	                <label for="DropDownPageTypeId">Grupy stron:</label>
                    <%= Html.DropDownList("DropDownPageTypeId", Model.PageTypesToDropDown,
                                    new { @class = "right-select300",
                                          onchange = "submitMenuItemForm(document.forms['menuForm']);"
                                    })%>
                </div>
                <div id="page-types-param" class="hidden">
				</div>																								                                    
 	            <div class="right-page-item400">
 	                <label for="DropDownPageId">Strony:</label>
                    <%= Html.DropDownList("DropDownPageId", Model.PagesToDropDown,
                                    new { @class = "right-select400" })%>
                </div>
            </div>    
    <% } //else empty %>        
<% } //else not combos %>